using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Package
{
    /// <summary>
    /// <para>Consolidate Project</para>
    /// <para>Consolidates a project (.aprx file) and referenced maps and data to a specified output folder.</para>
    /// <para>将工程（.aprx 文件）和引用的地图和数据合并到指定的输出文件夹。</para>
    /// </summary>    
    [DisplayName("Consolidate Project")]
    public class ConsolidateProject : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ConsolidateProject()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_project">
        /// <para>Input Project</para>
        /// <para>The project (.aprx file) to be consolidated.</para>
        /// <para>要合并的项目（.aprx 文件）。</para>
        /// </param>
        /// <param name="_output_folder">
        /// <para>Output Folder</para>
        /// <para>The output folder that will contain the consolidated project and data. If the specified folder does not exist, a new folder will be created.</para>
        /// <para>将包含合并项目和数据的输出文件夹。如果指定的文件夹不存在，则将创建一个新文件夹。</para>
        /// </param>
        public ConsolidateProject(object _in_project, object _output_folder)
        {
            this._in_project = _in_project;
            this._output_folder = _output_folder;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Consolidate Project";

        public override string CallName => "management.ConsolidateProject";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_project, _output_folder, _sharing_internal.GetGPValue(), _extent, _apply_extent_to_enterprise_geo.GetGPValue(), _package_as_template.GetGPValue(), _preserve_sqlite.GetGPValue(), _version.GetGPValue(), _select_related_rows.GetGPValue()];

        /// <summary>
        /// <para>Input Project</para>
        /// <para>The project (.aprx file) to be consolidated.</para>
        /// <para>要合并的项目（.aprx 文件）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Project")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_project { get; set; }


        /// <summary>
        /// <para>Output Folder</para>
        /// <para>The output folder that will contain the consolidated project and data. If the specified folder does not exist, a new folder will be created.</para>
        /// <para>将包含合并项目和数据的输出文件夹。如果指定的文件夹不存在，则将创建一个新文件夹。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Folder")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_folder { get; set; }


        /// <summary>
        /// <para>Share outside of organization</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the project and all data will be consolidated into a single folder (for sharing outside your organization) or referenced (for sharing inside your organization). Data paths referenced from enterprise geodatabases or a UNC file system can be shared internally. If your project was not built with data paths like this, the data will be consolidated into the project package.
        ///   <para>Data and maps will be consolidated and packaged if the project references them from a local path, such as c:\gisdata\landrecords.gdb\ regardless of this parameter's setting.</para>
        ///   </para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The project and its data sources will not be consolidated to the output folder. This is the default. This parameter applies to enterprise geodatabase data sources, including enterprise geodatabases and folders referenced via a UNC path.</bullet_item><para/>
        ///     <bullet_item>Checked—The project and its data sources will be copied and preserved when possible.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是将项目和所有数据合并到单个文件夹中（用于在组织外部共享）还是引用（用于在组织内部共享）。从企业级地理数据库或 UNC 文件系统引用的数据路径可以在内部共享。如果项目不是使用这样的数据路径生成的，则数据将合并到项目包中。
        ///   <para>如果工程从本地路径（如 c：\gisdata\landrecords.gdb\）引用数据和地图，则无论此参数的设置如何，都将合并和打包数据和地图。</para>
        ///   </para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 工程及其数据源不会合并到输出文件夹。这是默认设置。此参数适用于企业级地理数据库数据源，包括通过 UNC 路径引用的企业级地理数据库和文件夹。</bullet_item><para/>
        ///     <bullet_item>选中 - 将尽可能复制并保留工程及其数据源。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Share outside of organization")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _sharing_internal_value _sharing_internal { get; set; } = _sharing_internal_value._false;

        public enum _sharing_internal_value
        {
            /// <summary>
            /// <para>EXTERNAL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("EXTERNAL")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>INTERNAL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INTERNAL")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Extent</para>
        /// <para><xdoc>
        ///   <para>Specifies the extent that will be used to select or clip features.</para>
        ///   <bulletList>
        ///     <bullet_item>Default—The extent will be based on the maximum extent of all participating inputs. This is the default.</bullet_item><para/>
        ///     <bullet_item>Union of Inputs—The extent will be based on the maximum extent of all inputs.</bullet_item><para/>
        ///     <bullet_item>Intersection of Inputs—The extent will be based on the minimum area common to all inputs.</bullet_item><para/>
        ///     <bullet_item>Current Display Extent—The extent is equal to the visible display. The option is not available when there is no active map.</bullet_item><para/>
        ///     <bullet_item>As Specified Below—The extent will be based on the minimum and maximum extent values specified.</bullet_item><para/>
        ///     <bullet_item>Browse—The extent will be based on an existing dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于选择或裁剪要素的范围。</para>
        ///   <bulletList>
        ///     <bullet_item>默认值 - 范围将基于所有参与输入的最大范围。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>输入并集 - 范围将基于所有输入的最大范围。</bullet_item><para/>
        ///     <bullet_item>输入交点 - 范围将基于所有输入共有的最小面积。</bullet_item><para/>
        ///     <bullet_item>当前显示范围 - 范围等于可见显示。当没有活动地图时，该选项不可用。</bullet_item><para/>
        ///     <bullet_item>如下所述 - 范围将基于指定的最小和最大范围值。</bullet_item><para/>
        ///     <bullet_item>浏览 - 范围将基于现有数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _extent { get; set; } = null;


        /// <summary>
        /// <para>Apply Extent only to enterprise geodatabase layers</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the Extent parameter will be applied to all layers or to enterprise geodatabase layers only.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The extent will be applied to all layers. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—The extent will be applied to enterprise geodatabase layers only.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定范围参数是应用于所有图层还是仅应用于企业级地理数据库图层。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 范围将应用于所有图层。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 范围将仅应用于企业级地理数据库图层。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Apply Extent only to enterprise geodatabase layers")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _apply_extent_to_enterprise_geo_value _apply_extent_to_enterprise_geo { get; set; } = _apply_extent_to_enterprise_geo_value._false;

        public enum _apply_extent_to_enterprise_geo_value
        {
            /// <summary>
            /// <para>ENTERPRISE_ONLY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ENTERPRISE_ONLY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ALL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ALL")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Consolidate as template</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the project will be consolidated as a template or a regular project. Templates can include maps, layouts, connections to databases and servers, and so on. A project template allows you to standardize a series of maps for use in a project and ensure that the correct layers are immediately available for everyone to use in their maps.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The project will be consolidated as a project into a folder. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—The project will be consolidated as a template into a folder.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是将项目合并为模板还是常规项目。模板可以包括地图、布局、与数据库和服务器的连接等。工程模板允许您标准化一系列地图以在工程中使用，并确保正确的图层立即可供所有人在其地图中使用。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 工程将作为工程合并到文件夹中。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 工程将作为模板合并到文件夹中。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Consolidate as template")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _package_as_template_value _package_as_template { get; set; } = _package_as_template_value._false;

        public enum _package_as_template_value
        {
            /// <summary>
            /// <para>PROJECT_TEMPLATE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PROJECT_TEMPLATE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>PROJECT_PACKAGE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PROJECT_PACKAGE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Preserve SQLite Geodatabase</para>
        /// <para><xdoc>
        ///   <para>Specifies whether SQLite geodatabases will be preserved or converted to file geodatabases.
        ///   <para>This parameter applies only to .geodatabase files, used primarily for offline workflows in ArcGIS Runtime apps. SQLite databases with .sqlite or .gpkg file extensions will be converted to file geodatabases.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—SQLite geodatabases will be converted to file geodatabases. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—SQLite geodatabases will be preserved.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是保留 SQLite 地理数据库还是将其转换为文件地理数据库。
        ///   <para>此参数仅适用于 .geodatabase 文件，主要用于 ArcGIS Runtime 应用程序中的离线工作流。 文件扩展名为 .sqlite 或 .gpkg 的 SQLite 数据库将转换为文件地理数据库。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - SQLite 地理数据库将转换为文件地理数据库。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 将保留 SQLite 地理数据库。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Preserve SQLite Geodatabase")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _preserve_sqlite_value _preserve_sqlite { get; set; } = _preserve_sqlite_value._false;

        public enum _preserve_sqlite_value
        {
            /// <summary>
            /// <para>PRESERVE_SQLITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PRESERVE_SQLITE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>CONVERT_SQLITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CONVERT_SQLITE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Version</para>
        /// <para><xdoc>
        ///   <para>Specifies the ArcGIS Pro version the consolidated project will be saved as. Saving to an earlier version will ensure tool backward compatibility. If you attempt to consolidate a toolbox to an earlier version and capabilities that are only available in the newer version are included, an error will occur. You must remove tools that are incompatible with the earlier version, or specify a compatible version.</para>
        ///   <bulletList>
        ///     <bullet_item>Current version— The consolidated folder will contain geodatabases and maps compatible with the version of the current release.</bullet_item><para/>
        ///     <bullet_item>2.1—The consolidated folder will contain geodatabases and maps compatible with version 2.1.</bullet_item><para/>
        ///     <bullet_item>2.2— The consolidated folder will contain geodatabases and maps compatible with version 2.2.</bullet_item><para/>
        ///     <bullet_item>2.3—The consolidated folder will contain geodatabases and maps compatible with version 2.3.</bullet_item><para/>
        ///     <bullet_item>2.4—The consolidated folder will contain geodatabases and maps compatible with version 2.4.</bullet_item><para/>
        ///     <bullet_item>2.5—The consolidated folder will contain geodatabases and maps compatible with version 2.5.</bullet_item><para/>
        ///     <bullet_item>2.6—The consolidated folder will contain geodatabases and maps compatible with version 2.6.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定合并工程将另存为 ArcGIS Pro 版本。保存到早期版本将确保工具向后兼容。如果尝试将工具箱合并到较早版本，并且包含仅在较新版本中可用的功能，则会发生错误。您必须删除与早期版本不兼容的工具，或指定兼容版本。</para>
        ///   <bulletList>
        ///     <bullet_item>当前版本- 合并文件夹将包含与当前版本兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.1 - 合并文件夹将包含与版本 2.1 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.2 - 合并文件夹将包含与版本 2.2 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.3 - 合并文件夹将包含与版本 2.3 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.4 - 合并文件夹将包含与版本 2.4 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.5 - 合并文件夹将包含与版本 2.5 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.6 - 合并文件夹将包含与版本 2.6 兼容的地理数据库和地图。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Version")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _version_value _version { get; set; } = _version_value._CURRENT;

        public enum _version_value
        {
            /// <summary>
            /// <para>Current version</para>
            /// <para>Current version— The consolidated folder will contain geodatabases and maps compatible with the version of the current release.</para>
            /// <para>当前版本- 合并文件夹将包含与当前版本兼容的地理数据库和地图。</para>
            /// </summary>
            [Description("Current version")]
            [GPEnumValue("CURRENT")]
            _CURRENT,

            /// <summary>
            /// <para>2.1</para>
            /// <para>2.1—The consolidated folder will contain geodatabases and maps compatible with version 2.1.</para>
            /// <para>2.1 - 合并文件夹将包含与版本 2.1 兼容的地理数据库和地图。</para>
            /// </summary>
            [Description("2.1")]
            [GPEnumValue("2.1")]
            value1,

            /// <summary>
            /// <para>2.2</para>
            /// <para>2.2— The consolidated folder will contain geodatabases and maps compatible with version 2.2.</para>
            /// <para>2.2 - 合并文件夹将包含与版本 2.2 兼容的地理数据库和地图。</para>
            /// </summary>
            [Description("2.2")]
            [GPEnumValue("2.2")]
            value2,

            /// <summary>
            /// <para>2.3</para>
            /// <para>2.3—The consolidated folder will contain geodatabases and maps compatible with version 2.3.</para>
            /// <para>2.3 - 合并文件夹将包含与版本 2.3 兼容的地理数据库和地图。</para>
            /// </summary>
            [Description("2.3")]
            [GPEnumValue("2.3")]
            value3,

            /// <summary>
            /// <para>2.4</para>
            /// <para>2.4—The consolidated folder will contain geodatabases and maps compatible with version 2.4.</para>
            /// <para>2.4 - 合并文件夹将包含与版本 2.4 兼容的地理数据库和地图。</para>
            /// </summary>
            [Description("2.4")]
            [GPEnumValue("2.4")]
            value4,

            /// <summary>
            /// <para>2.5</para>
            /// <para>2.5—The consolidated folder will contain geodatabases and maps compatible with version 2.5.</para>
            /// <para>2.5 - 合并文件夹将包含与版本 2.5 兼容的地理数据库和地图。</para>
            /// </summary>
            [Description("2.5")]
            [GPEnumValue("2.5")]
            value5,

            /// <summary>
            /// <para>2.6</para>
            /// <para>2.6—The consolidated folder will contain geodatabases and maps compatible with version 2.6.</para>
            /// <para>2.6 - 合并文件夹将包含与版本 2.6 兼容的地理数据库和地图。</para>
            /// </summary>
            [Description("2.6")]
            [GPEnumValue("2.6")]
            value6,

            /// <summary>
            /// <para>2.7</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("2.7")]
            [GPEnumValue("2.7")]
            value7,

        }

        /// <summary>
        /// <para>Keep only the rows which are related to features within the extent</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the specified extent will be applied to related data sources.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Related data sources will be consolidated in their entirety. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Only related data corresponding to records within the specified extent will be consolidated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将指定的范围应用于相关数据源。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 相关数据源将全部合并。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 仅合并与指定范围内的记录对应的相关数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep only the rows which are related to features within the extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _select_related_rows_value _select_related_rows { get; set; } = _select_related_rows_value._false;

        public enum _select_related_rows_value
        {
            /// <summary>
            /// <para>KEEP_ONLY_RELATED_ROWS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_ONLY_RELATED_ROWS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_ALL_RELATED_ROWS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_ALL_RELATED_ROWS")]
            [GPEnumValue("false")]
            _false,

        }

        public ConsolidateProject SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}